﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using SwertressSMS.helper;

namespace SwertressSMS
{
    public partial class FrmLogin : Form
    {
        public FrmLogin()
        {
            InitializeComponent();

            //register button listener
            this.BtnCancel.Click += new EventHandler(this.button_click);
            this.BtnLogin.Click += new EventHandler(this.button_click);
        }

        /**
         *  Button click handler
         *  @params Object sender
         *  @params eEentArgs e
         *  @access protected
         *  @return void
         * 
         * */
        protected void button_click(Object sender, EventArgs e)
        {
            FrmMain main = new FrmMain();
            Button btn_ref = (Button)sender;

            if (btn_ref.Tag.ToString().ToLower() == "login")
            {
                FormHelper.showForm(main, false);
                FormHelper.hideForm(this);                
            }
            else
            {
                if (btn_ref.Tag.ToString().ToLower() == "cancel")
                {
                    Application.Exit();
                }
            }            
        }       
    }
}
